package 第1节循环语句;

public class LianXi02 {
    public static void main(String[] args) {
        for (int row = 1; row <= 7; row++) {
            for (int k = 1; k <= 7 - row; k++) {
                System.out.print(" " + " ");
            }
            for (int x = 1 - row ; x <= row - 1; x++) {
                System.out.print(Math.abs(x) + 1 + " ");
            }
            System.out.println();
        }
        for (int row = 1; row <= 6; row++) {
            for (int k = 1; k <= 6 - row; k++) {
                System.out.print("   ");
            }
            for (int x = 1 - row; x <= row - 1; x++) {
                int mi = row - 1 - Math.abs(x);
                int num = (int)Math.pow(2,mi);
                System.out.printf("%-3d", num);
            }
            System.out.println();
        }


    }
}
/*
               1
            1  2  1
         1  2  4  2  1
      1  2  4  8  4  2  1
   1  2  4  8  16 8  4  2  1
1  2  4  8  16 32 16 8  4  2  1
*/
